import SvgIcon from "./SvgIcon/index.vue";
import Pagination from "./Pagination/index.vue";
import Category from "@/components/Category/index.vue";
// 全局对象
const allGlobalComponent: any = { SvgIcon, Pagination, Category };
// 引入ele提供的全部图标组件
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
// 对外暴露插件对象
export default {
  // 必须命名为install
  install(app: any) {
    Object.keys(allGlobalComponent).forEach((key) => {
      // 注册全局组件
      app.component(key, allGlobalComponent[key]);
    });
    // 将ele提供的图标注册为全局组件
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component);
    }
  },
};
